package com.example.s.bean;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.orm.SugarRecord;
import com.orm.dsl.Unique;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public class LoopImg extends SugarRecord {

    /**
     * id : 17
     * img_url : ../images/1622289978589-light_download.jpg
     */
    @Unique
    private transient int id;
    private String img_url;

    public static LoopImg objectFromData(String str) {

        return new Gson().fromJson(str, LoopImg.class);
    }

    public static List<LoopImg> arrayLoopImgFromData(String str) {

        Type listType = new TypeToken<ArrayList<LoopImg>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public Long getId() {
        return Long.valueOf(id);
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getImg_url() {
        return img_url;
    }

    public void setImg_url(String img_url) {
        this.img_url = img_url;
    }
}
